package com.project.communitymanagement.controller;

import com.project.communitymanagement.common.BaseController;
import com.project.communitymanagement.common.GetId;
import com.project.communitymanagement.common.Request;
import com.project.communitymanagement.common.ResponseEntity;
import com.project.communitymanagement.entity.TbTurnover;
import com.project.communitymanagement.service.TbTurnoverService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @ProjectName: epidemic-prevention-backend
 * @Package: com.project.communitymanagement.controller
 * @ClassName: TbTurnoverController
 * @Author: "XGP"
 * @Description:
 * @Date: 2022/03/23 10:36
 * @Version: 1.0
 */
@RestController
@CrossOrigin
@RequestMapping("tbturnover")
public class TbTurnoverController extends BaseController<TbTurnoverService, TbTurnover> {

    @Autowired
    private TbTurnoverService tbturnoverService;

    @Override
    protected TbTurnoverService service() {
        return tbturnoverService;
    }

    @PostMapping("goOut")
    public ResponseEntity goOut(@RequestBody Request<TbTurnover> data) {
        return ResponseEntity.success(tbturnoverService.goOut(data.getData()));
    }

    @GetMapping("getLongId")
    public ResponseEntity goOut() {
        return ResponseEntity.success(GetId.getId());
    }
}

